package com.halflife.parameter.template;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.halflife.framework.generator.annotation.QueryAnn;
import com.halflife.framework.generator.build.SimpleBuilder;
import com.halflife.framework.generator.build.UpdataBuilder;
import org.junit.jupiter.api.Test;
//https://api.hubapi.com/companies/v2/companies/paged?hapikey=20eca147-5b6e-4ad4-8bfa-1f54fa43742e&properties=name&limit=250
@QueryAnn(title = "Companys",mainTitle = "Companys",table = "t_parameter_company")
public class Companys {
    public Companys(){}

    public Companys(CompanyJson json) {
        this.id = json.getCompanyId();
        this.name =  json.getProperties().getName().getValue();
        this.status = "0";
        this.valid = true;
    }
    @Test
    public void generate0()throws Exception{
        SimpleBuilder builder = new SimpleBuilder();
        builder.buildAll(this.getClass());
    }
    @Test
    public void generate()throws Exception{
        UpdataBuilder builder = new UpdataBuilder();
        builder.buildMapper(this.getClass());
//        builder.buildAlterTable(this.getClass());
    }
    private Long id;
    @QueryAnn(value = "Name",operate = "like")
    @JSONField(name = "" +
            "")
    private String name;
    @QueryAnn("Status")
    private String status;
    @QueryAnn(value = "Valid")
    private Boolean valid;
    public void init(){
        this.valid = true;
        this.status = "0";
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Boolean getValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }
}
